package com.maistars.spider.service.process.html;

import com.maistars.spider.service.domain.rule.FieldRule;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * @author dhr
 * @date 2021/1/30 上午12:39
 */
@Data
public abstract class HtmlProcessor {

    protected HtmlProcessorConfig htmlProcessorConfig;

    protected Map<String,Object> processorContext;

    protected FieldRule fieldRule;

    protected String htmlContent;

    public HtmlProcessor(String htmlContent,FieldRule fieldRule, HtmlProcessorConfig htmlProcessorConfig, Map<String,Object> processorContext){
        this.htmlContent = htmlContent;
        this.htmlProcessorConfig = htmlProcessorConfig;
        this.processorContext = processorContext;
        this.fieldRule = fieldRule;
    }

    public abstract HtmlProcessor init();

    public abstract List<String> process(List<String> contents);

}
